import {COMPONENT_TYPE} from '../../../../../libs/constants'

export default [
  // {
  //   type: COMPONENT_TYPE.INPUT,
  //   formItem: {
  //     prop: 'dataSourceUrl',
  //     rules: [
  //       { required: true, message: '请输入数据源url', trigger: 'blur' },
  //       { min: 3, message: '请输入数据源url值最小长度为5个字符', trigger: 'blur' }
  //     ],
  //     label: '数据源',
  //     extra: '数据源url地址',
  //     labelCol: {
  //       span: 6,
  //       offset: 0
  //     },
  //     wrapperCol: {
  //       span: 18,
  //       offset: 0
  //     }
  //   },
  //   attrs: {
  //     value: 'http://',
  //     type: 'text',
  //     allowClear: true,
  //     placeholder: '请输入数据源url'
  //   }
  // },
  {
    id: '1',
    type: COMPONENT_TYPE.INPUT,
    formItem: {
      prop: 'rowKey',
      rules: [
        {required: true, message: '请输入行key值', trigger: 'blur'},
        {min: 3, message: '行key值最小长度为1个字符', trigger: 'blur'}
      ],
      label: '行key值',
      extra: '表格行 key 的取值，字符串',
    },
    attrs: {
      value: 'id',
      type: 'text',
      allowClear: true,
      placeholder: '请输入行key值'
    }
  },
  {
    id: '2',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      prop: 'tableLayout',
      rules: [],
      label: '表格布局',
      extra: '表格布局  - | auto | fixed ',
    },
    attrs: {
      value: 'fixed',
      buttonStyle: 'solid',
      children: [
        {
          value: '-',
          label: '-'
        },
        {
          value: 'auto',
          label: 'auto'
        },
        {
          value: 'fixed',
          label: 'fixed'
        }
      ]
    }
  },
  {
    id: '3',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      prop: 'bordered',
      rules: [],
      label: '边框',
      extra: '是否展示外边框和列边框',
    },
    attrs: {
      checked: false
    }
  },
  {
    id: '4',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      prop: 'defaultExpandAllRows',
      rules: [],
      label: '展开所有',
      extra: '初始时，是否展开所有行',
    },
    attrs: {
      checked: false
    }
  },
  {
    id: '5',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      prop: 'size',
      rules: [],
      label: '表格大小',
      extra: '表格大小  default | middle | small ',
    },
    attrs: {
      value: 'default',
      buttonStyle: 'solid',
      children: [
        {
          value: 'default',
          label: 'default'
        },
        {
          value: 'middle',
          label: 'middle'
        },
        {
          value: 'small',
          label: 'small'
        }
      ]
    }
  },
  {
    id: '6',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      prop: 'page',
      rules: [],
      label: '分页组件',
      extra: '开启使用分页组件',
    },
    attrs: {
      checked: true
    }
  },
  {
    id: '7',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      prop: 'pageJustifyContent',
      rules: [],
      label: '分页组件位置',
      extra: '分页组件位置 左侧| 中间 | 右侧 ',
    },
    attrs: {
      value: 'flex-end',
      children: [
        {
          value: 'flex-start',
          label: '左侧'
        },
        {
          value: 'center',
          label: '中间'
        },
        {
          value: 'flex-end',
          label: '右侧'
        }
      ]
    }
  },
  {
    id: '8',
    type: COMPONENT_TYPE.INPUT_NUMBER,
    formItem: {
      prop: 'pagination.current',
      rules: [],
      label: '当前页码',
    },
    attrs: {
      value: 1,
      min: 0,
      allowClear: true,
      placeholder: '请输入当前页码'
    }
  },
  {
    id: '9',
    type: COMPONENT_TYPE.INPUT_NUMBER,
    formItem: {
      prop: 'pagination.pageSize',
      rules: [],
      label: '每页条数',
    },
    attrs: {
      value: 10,
      min: 1,
      allowClear: true,
      placeholder: '请输入每页条数'
    }
  },
  {
    id: '10',
    type: COMPONENT_TYPE.TEXTAREA,
    formItem: {
      prop: 'pagination.pageSizeOptions',
      rules: [],
      label: '每页显示条数',
      extra: '指定每页可以显示多少条',
    },
    attrs: {
      autoSize: {
        minRows: 2
      },
      value: "['10', '20', '30', '40']",
      maxLength: 1000,
      allowClear: true,
      placeholder: '请输入每页显示条数'
    }
  },
  {
    id: '11',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      prop: 'pagination.size',
      rules: [],
      label: '分页大小',
    },
    attrs: {
      value: '-',
      children: [
        {
          value: 'small',
          label: 'small'
        },
        {
          value: '-',
          label: 'default'
        }
      ]
    }
  },
  {
    id: '12',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      prop: 'pagination.hideOnSinglePage',
      rules: [],
      label: '单页隐藏',
      extra: '只有一页时是否隐藏分页器',
    },
    attrs: {
      checked: false
    }
  },
  {
    id: '13',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      prop: 'isSelect',
      rules: [],
      label: '列表选择',
      extra: '列表项是否可选择',
    },
    attrs: {
      checked: false
    }
  },
  {
    id: '14',
    type: COMPONENT_TYPE.SWITCH,
    formItem: {
      prop: 'selectIsFixed',
      rules: [],
      label: '选择固定',
      extra: '列表选择固定在最左侧，默认false。注意：使用时，需要使至少一列宽度为比例形式，即 列宽非固定方式，否则样式会发生一些错乱',
    },
    attrs: {
      checked: false
    }
  },
  {
    id: '15',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      prop: 'selectType',
      rules: [],
      label: '列表选择类型',
      extra: '列表选择类型  checkbox | radio ',
    },
    attrs: {
      value: 'checkbox',
      buttonStyle: 'solid',
      children: [
        {
          value: 'checkbox',
          label: 'checkbox'
        },
        {
          value: 'radio',
          label: 'radio'
        }
      ]
    }
  },
  {
    id: '16',
    type: COMPONENT_TYPE.TEXTAREA,
    formItem: {
      prop: 'scroll.x',
      rules: [],
      label: '滚动配置x',
      extra: '设置横向或纵向滚动，也可用于指定滚动区域的宽和高，建议为 x 设置一个数字，如果要设置为 true，需要配合样式 .ant-table td { white-space: nowrap; }',
    },
    attrs: {
      autoSize: {
        minRows: 2
      },
      value: 'calc( 100vw - 500px )',
      maxLength: 2000,
      allowClear: true,
      placeholder: '请输入滚动配置'
    }
  },
  {
    id: '17',
    type: COMPONENT_TYPE.TEXTAREA,
    formItem: {
      prop: 'scroll.y',
      rules: [],
      label: '滚动配置y',
      extra: '设置横向或纵向滚动，也可用于指定滚动区域的宽和高，建议为 x 设置一个数字，如果要设置为 true，需要配合样式 .ant-table td { white-space: nowrap; }',
    },
    attrs: {
      autoSize: {
        minRows: 2
      },
      value: 'calc( 100vh - 500px )',
      maxLength: 2000,
      allowClear: true,
      placeholder: '请输入滚动配置'
    }
  },
  {
    id: '18',
    type: COMPONENT_TYPE.RADIO_BUTTON,
    formItem: {
      prop: 'btnJustifyContent',
      rules: [],
      label: '按钮组件位置',
      extra: '按钮组件位置 左侧| 中间 | 右侧 ',
    },
    attrs: {
      value: 'flex-start',
      children: [
        {
          value: 'flex-start',
          label: '左侧'
        },
        {
          value: 'center',
          label: '中间'
        },
        {
          value: 'flex-end',
          label: '右侧'
        }
      ]
    }
  }
]

